<!--
 * @Description: 
 * @Author: Zhangx
 * @Date: 2023-08-02 16:11:16
 * @LastEditors: Zhangxx 2425792130@qq.com
 * @LastEditTime: 2024-06-20 10:04:09
-->
<template>
  <div class="header-container">
    <div class="l-content">
      <el-button @click="handleMenu" style="margin-right: 20px;">
        <el-icon><Grid /></el-icon>
      </el-button>
      <!-- 面包屑 -->
      <!-- <span class="text">首页</span> -->
      <el-breadcrumb separator="/">
      <el-breadcrumb-item v-for="item in tags" :key="item.path" :to="{path:item.path}">{{item.label}}</el-breadcrumb-item>
    </el-breadcrumb>
    </div>
    <div class="r-content">
      <!-- <el-dropdown>
        <span class="el-dropdown-link">
          <img src="" alt="" class="user">
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>退出</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown> -->
      <el-dropdown>
      <span class="el-dropdown-link">
        Dropdown List
        <el-icon class="el-icon--right">
          <arrow-down />
        </el-icon>
      </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click="changeLang('zh')">中文</el-dropdown-item>
          <el-dropdown-item @click="changeLang('zh')">English</el-dropdown-item>
          <el-dropdown-item @click="changeLang('zh')">繁体</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import store from '@/stores';
import { Grid, ArrowDown } from '@element-plus/icons-vue'
import {useI18n} from 'vue-i18n'
const { locale } = useI18n()
const handleMenu = () => {
  store.commit('collapseMenu')
}

const tags = computed(()=>store.state.tab.tabsList)

const changeLang = (type:any) => {
  locale.value = type
  localStorage.setItem('lang',type)
}
</script>

<style lang="scss" scoped>
::v-deep(.el-header) {
  --el-header-padding:0;
}

.header-container {
  padding: 0 20px;
  background-color: #bbe3b7;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .text {
    color: #fff;
    font-size: 14px;
    margin-left: 10px;
  }
  .l-content {
    display: flex;
    align-items: center;
     :deep(.el-breadcrumb__item) {
      :deep(.el-breadcrumb__inner) {
        font-weight: normal;
        &.is-link{
          color:#fff;
        }
      }
      &:last-child {
        .el-breadcrumb__inner {
          color:#fff;
        }
      }
    }
  }
  // .r-content {
  //   width: 100px;
  //   height: 60px;
  //   background-color: green;
  //   box-sizing: border-box;
  // }
}
// .example-showcase .el-dropdown-link {
//   cursor: pointer;
//   color: var(--el-color-primary);
//   display: flex;
//   align-items: center;
// }
</style>